package com.ehotting.edsta.circuitDesign.enums;

public enum CodeDataTypeEnum implements BaseEnum {

    PROP(0,"prop","属性"),
    /**
     * 从客户过来转换参数,应用于电路筛选和元器件筛选
     * {@link com.ehotting.edsta.circuitDesign.gen.element.ElementScriptEngine#genScript(Long)}
     * {@link com.ehotting.edsta.circuitDesign.gen.circuit.CircuitScriptEngine#gen}
     */
    INPUT_PARAM(1,"input","输入参数"),
    OUTPUT_PARAM(2,"output","输出参数");


    private Integer value;
    private String code;
    private String name;

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    CodeDataTypeEnum(Integer value, String code, String name) {
        this.value = value;
        this.code = code;
        this.name = name;
    }


    public static CodeDataTypeEnum getObject(Integer value){
        CodeDataTypeEnum[] rules = CodeDataTypeEnum.values();
        for(CodeDataTypeEnum rule : rules){
            if(rule.getValue().equals(value)){
                return rule;
            }
        }
        return CodeDataTypeEnum.PROP;
    }

}
